home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue32 / construc / DRBOBWEB.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-03-09  |  1.5 KB  |  64 lines

  1. unit DrBobWeb;
  2. interface
  3. uses
  4.   DsgnIntf, DBTables, DBWeb;
  5.  
  6. type
  7.   TBQueryTableProducer = class(TQueryTableProducer)
  8.   private
  9.     FQueryHTML: ShortString;
  10.   published
  11.     property QueryHTML: ShortString read FQueryHTML write FQueryHTML;
  12.   end {TBQueryTableProducer};
  13.  
  14. type
  15.   TQueryHTMLProperty = class(TStringProperty)
  16.   public
  17.     function GetAttributes: TPropertyAttributes; override;
  18.     procedure Edit; override;
  19.   end;
  20.  
  21.   procedure Register;
  22.  
  23. implementation
  24. uses
  25.   DrBobWiz, Classes, Controls, Forms;
  26.  
  27.   function TQueryHTMLProperty.GetAttributes: TPropertyAttributes;
  28.   begin
  29.     Result := [paDialog]
  30.   end {GetAttributes};
  31.  
  32.   procedure TQueryHTMLProperty.Edit;
  33.   begin
  34.     with TFormWizard.Create(Application) do
  35.     try
  36.       with (GetComponent(0) AS TQueryTableProducer) do
  37.       begin
  38.         if Assigned(Query) then
  39.         begin
  40.           ComboBoxAliases.Text := (Query AS TQuery).DatabaseName;
  41.           MemoSQL.Lines.Assign((Query AS TQuery).SQL);
  42.           if Assigned((Query AS TQuery).Params) then
  43.             TheQuery.Params.Assign((Query AS TQuery).Params)
  44.         end
  45.       end;
  46.       if ShowModal = mrOK then
  47.       begin
  48.         SetValue(EditFileName.Text);
  49.         Finish
  50.       end
  51.     finally
  52.       Free
  53.     end;
  54.     Modified
  55.   end {Edit};
  56.  
  57.   procedure Register;
  58.   begin
  59.     RegisterComponents('internet',[TBQueryTableProducer]);
  60.     RegisterPropertyEditor(TypeInfo(ShortString), TBQueryTableProducer,
  61.                           'QueryHTML', TQueryHTMLProperty)
  62.   end;
  63. end.
  64.